package com.fwmagic.spark.core.cases.globalsort

object SortContext {

    implicit val manSortRules :Ordering[CaseMan] = new Ordering[CaseMan]{
        override def compare(x: CaseMan, y: CaseMan): Int = {
            if (x.faceValue == y.faceValue){
                x.age - y.age
            }else{
                -(x.faceValue - y.faceValue).toInt
            }
        }
    }

}
case class CaseMan(name:String,age:Int,faceValue:Double)